/*
 * Copyright (c) 2025 Li Auto Inc. and its affiliates
 *
 * Licensed under the Apache License, Version 2.0 (the "License");
 * you may not use this file except in compliance with the License.
 * You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

/*
 * This file was generated form {{ Idlfilename }}.idl by the mvbs-idl-gen tool.
 */


#include <mvbs/sections/start_sec_code.h>
#include <mvbs/sections/start_sec_bss.h>
#include <mvbs/sections/start_sec_const.h>
#include <mvbs/sections/start_sec_data.h>

{% import './general/typeMacros.jinja2' as Macros -%}
{% import './general/typeMacrosPro.jinja2' as MacrosPro -%}
{% import './general/typePluginMacros.jinja2' as PluginMacros -%}

#include <string.h>

#include <mvbs/errno.h>
#include <mvbs/core.h>
#include <mvbs/utils/cdefs.h>
#include <mvbs/rtps/message.h>

#include <mcdr/mcdr.h>

#include <mvbs/utils/string.h>
#include <mvbs/utils/mm.h>

#include "{{ Idlfilename }}Plugin.h"

{{ Macros.getCompatibleFlag(constructMapList) }}

{%- for node in constructMapList %}
{%- if node.constructKind != "const" %}

{{ Macros.CreateNewFunctiondefinition(node) }}

{{ Macros.defineGetTopicMaxSize(node) }}
{{ PluginMacros.defineTopicInit(node) }}

{{ Macros.defineTopicSerialize(node) }}

{%- if node.extensibility == "COMPATIBLE_EXTENSIBILITY" %}
{{ Macros.defineTopicDeserializeCompat(node) }}
{%- else %}
{{ Macros.defineTopicDeserialize(node) }}
{%- endif %}
{%- if node.constructKind == "struct" %}
{{ PluginMacros.defineGetMaxSize(node) }}

{{ PluginMacros.defineSerialize(node) }}

{{ PluginMacros.defineDeserialize(node) }}

{%- if envMap['test_mode'] == "true" -%}
{{ Macros.defineTopicCreate(node) }}

{{ Macros.defineTopicDelete(node) }}
{%- endif %}
{%- endif %}
{%- endif %}
{%- endfor %}{{"\n"}}
{{- Macros.typePluginMicro(constructMapList,Idlfilename, envMap) }}

#include <mvbs/sections/stop_sec_data.h>
#include <mvbs/sections/stop_sec_const.h>
#include <mvbs/sections/stop_sec_bss.h>
#include <mvbs/sections/stop_sec_code.h>
